$(document).ready(function(){
    // set xunlei url
    $(".xl_cloud_btn").click( function(){
        window.open( 'http://vod.xunlei.com/home.html?playurl='+encodeURIComponent( $(this).attr( 'magurl') ));
    });
    
    $('a[id^="filter_item_"]').each(function(){
        $(this).click(function(){
            var type=$(this).attr('filter-type');
            var season=$(this).attr('season');
            
            $('#filter_ul_'+season+' > li').removeClass("active");
            $(this).parent().addClass("active");
            
            if( type == "ALL" ){
                $('#season'+season+' > table > tbody > tr').show();
            }
            else{
                $('#season'+season+' > table > tbody > tr').hide();
                $('#season'+season+' > table > tbody > tr[item-type="'+type+'"]').show();
            }
        });
    });
    
    if( $("#full_intro").val() != "" ){
        $('#show_more').show();
        $('#show_more').click(function(){
            if($(this).html() == "[展开全文]"){
                $('#intro_content').html( $("#full_intro").val() );
                $(this).html("[收起]")
            }
            else if($(this).html() == "[收起]"){
                $('#intro_content').html($("#short_intro").val());
                $(this).html("[展开全文]")
            }
        });
    }
});